package com.qianxx.component.activity.list.pull_to_zoom_list_view;

import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ImageView;

import com.qianxx.component.R;
import com.qianxx.component.activity.base.BaseActivity;
import com.qianxx.viewlibrary.list.pulltozoomlistview.PullToZoomListView;

import butterknife.BindView;
import butterknife.ButterKnife;

public class PullToZoomListViewActivity extends BaseActivity {
    @BindView(R.id.pull_to_zoom_list_view)
    PullToZoomListView pull_to_zoom_list_view;
    String[] list = new String[]{"雪铁龙", "奥迪", "宝马",
            "阿斯顿马丁", "保时捷", "雷克萨斯", "兰博基尼", "奔驰",
            "劳斯莱斯", "英菲尼迪", "宾利", "捷豹"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pull_to_zoom_list_view);
        ButterKnife.bind(this);

        initView();
    }

    private void initView() {
        pull_to_zoom_list_view.setAdapter(new ArrayAdapter<String>(
                PullToZoomListViewActivity.this,
                android.R.layout.simple_list_item_1, list));
        ((ImageView) pull_to_zoom_list_view.getHeaderView())
                .setImageResource(R.drawable.p5);
        ((ImageView) pull_to_zoom_list_view.getHeaderView())
                .setScaleType(ImageView.ScaleType.CENTER_CROP);
    }

    @Override
    public String setTitle() {
        return "PullToZoomListView";
    }
}
